home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 49 / Amiga Format CD49 (2000-01-17)(Future Publishing)(GB)(Track 1 of 3)[!][issue 2000-02].iso / -serious- / graphics / amicad / arexx_english / mapkey.amicad < prev    next >
Text File  |  1999-12-06  |  1KB  |  42 lines

  1. /* MapKey
  2. Programmation d'une séquence de touches
  3. Version 1.00e (25 septembre 1999)
  4. $VER: MapKey.AmiCAD 1.00e (® R.Florac, 25 septembre 1999) */
  5.  
  6. options results     /* indispensable pour récupérer le résultat des macros */
  7.  
  8. signal on error     /* pour l'interception des erreurs */
  9. signal on syntax
  10.  
  11. keys=getclip(key_sequence)
  12. if key~="" then keys=doublage_guillemets(keys)
  13. 'INIT(KEY_SEQ,KEY_MACRO):KEY_SEQ=ASKTEXT("Key sequence"+CHR(10)+"to program ?","'keys'")'
  14. key=result
  15. if key~="" then do
  16.     setclip(key_sequence,key)
  17.     'KEY_MACRO=ASKTEXT("Macro to associate to "+KEY_SEQ,READMAP(KEY_SEQ))'
  18.     if result~="" then 'MAP(KEY_SEQ,KEY_MACRO)'
  19. end
  20.  
  21. exit
  22.  
  23. doublage_guillemets: procedure
  24.     parse arg chaine
  25.     t=''
  26.     do i=1 to length(chaine)
  27.     c = substr(chaine,i,1)
  28.     if c='"' then c=c||'"'
  29.     t=t||c
  30.     end
  31.     return t
  32.  
  33. /* Traitement des erreurs, interruption du programme */
  34. syntax:
  35. erreur=RC
  36. 'MESSAGE("Script MapKey.AmiCAD"+CHR(10)+"Syntax error"+CHR(10)+"in line 'SIGL'"+CHR(10)+"'errortext(erreur)'")'
  37. exit
  38.  
  39. error:
  40. 'MESSAGE("Script MapKey.AmiCAD"+CHR(10)+"Error in line 'SIGL'")'
  41. exit
  42.